package com.it.mapper;
import com.it.pro.Emp;
import org.apache.ibatis.annotations.*;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface EmpMapper {
    @Select("select * from emp")
    List<Emp> findByPage(String name, Integer gender, LocalDate begin, LocalDate end);
    @Delete("delete from emp where id=#{id}")
    void delete(Integer id);
   @Insert("insert into emp(name,username,gender,job,entrydate,create_time,update_time) values(#{name},#{username},#{gender},#{job},#{entrydate},now(),now())")
    void save(Emp emp);
    @Select("select * from emp where id=#{id}")
    Emp get(Integer id);
    @Update("update emp set name=#{name},username=#{username},gender=#{gender},job=#{job},entrydate=#{entrydate},update_time=now() where id=#{id}")
    void update(Emp emp);
}